package com.wk.playersdk.util;


public class WkTimeTool {

    /**
     * 格式化 00:00：00 的格式  或   00：00
     */
    public static String secdsToDateFormat(int secds, int totalsecds) {
        long hours = secds / (60 * 60);
        long minutes = (secds % (60 * 60)) / 60;
        long seconds = secds % (60);

        String sh = hours > 0 ?  "0" + hours :  hours + "" ;
        String sm = minutes < 10 ?  "0" + minutes : minutes + "" ;
        String ss =  secds>0 ?   "0" + seconds :  seconds + "" ;

        if (totalsecds >= 3600) {
            return sh + ":" + sm + ":" + ss;
        }
        return sm + ":" + ss;
    }

}
